package com.guyaogg.gulimall.order.config;

import com.guyaogg.gulimall.order.interceptor.LoginUserInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author 顾遥
 */
@Configuration
public class OrderWebConfiguration implements WebMvcConfigurer {

    private final LoginUserInterceptor loginUserInterceptor;

    public OrderWebConfiguration(LoginUserInterceptor loginUserInterceptor) {
        this.loginUserInterceptor = loginUserInterceptor;
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(loginUserInterceptor).addPathPatterns("/**");
    }
}
